<!--?xml version="1.0" encoding="UTF-8"?-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="vi" lang="vi"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Đơn Hàng</title>
<!-- base href="http://shopmayvn.com/admin/" -->
<link rel="stylesheet" type="text/css" href="/css/admin/invoice.css">
</head>
<body>

<?php require_once 'CMS/Util.php';
$tb_Things=new Admin_Model_Things();
$dateInt = new Util();?>
<?php if(count($this->Bill)!=0)
          foreach ($this->Bill as $bill){?>
<div style="page-break-after: always;">
  <h1>Order</h1>
  <div class="div1">
    <table width="100%">
    
      <tbody><tr>
        <td><b>Shop name:</b> Shop Online<br/>
          <b>Address:</b> Address 1<br/>
          <b>Phone:</b> 123456789<br/>
          <b>E-mail:</b> cms@gmail.com<br/>
          <b>Website:</b> http://cms.com</td>
        <td align="right" valign="top"><table>
            <tbody><tr>
              <td><b>Created Date:</b></td>
              <?php $Update_Date=$dateInt->makeDays($bill["updated_date"]); ?>
              <td><?php echo $Update_Date?></td>
            </tr>
                        <tr>
              <td><b>Order ID:</b></td>
              <td><?php echo $bill['bill_id']?></td>
            </tr>
          </tbody></table></td>
      </tr>
    </tbody></table>
  </div>
  <table class="address">
    <tbody><tr class="heading">
      <td width="50%"><b>Customer info</b></td>
      <td width="50%"><b>Shipping info</b></td>
    </tr>
    <tr>
      <td>
        <b>Full name: </b><?php echo $bill["full_name"]?><br/>
        <b>Email: </b><?php echo $bill["email"]?><br/>
                        <b>Phone: </b><?php echo $bill["phone"]?><br/>
                        <b>Address: </b><?php echo $bill["address"]?><br/>
                        
      </td>
      <td>
        <b>Delivery Address: </b><?php echo $bill["d_address"]?><br/> 
        <?php $ship_time=unserialize($bill["ship_time"])?>   
        <b>Ship time: </b><?php echo $ship_time['gio'].":".$ship_time['phut']." ",$ship_time['ngay']."/".$ship_time['thang']."/".$ship_time['nam']?><br/>   
      </td>
    </tr>
  </tbody></table>
  <table class="product">
  <?php if(count($this->BillDetail)){$i=0;?>
    <tbody><tr class="heading">
      <td><b>Product</b></td>
      <td><b>Product ID</b></td>
      <td align="right"><b>Quantity</b></td>
      <td align="right"><b>Price </b></td>
      <td align="right"><b>Total Price</b></td>
    </tr>
    <?php foreach ($this->BillDetail as $billdetail)
	          {$i++;
	          $thingdetail=$tb_Things->getThingById($billdetail['thing_id']);
	          ?>
        <tr>
      <td><?php echo $thingdetail[0]['title']?></td>
      <td><?php echo $billdetail['thing_id']?></td>
      <td align="right"><?php echo $billdetail['quantity']?></td>
      <td align="right"><?php echo number_format($billdetail['price'])?> VNĐ</td>
      <td align="right"><?php echo number_format($billdetail['total_price'])?> VNĐ</td>
    </tr>
    <?php }?>
    <tr>
      <td colspan="4" align="right"><b>Total:</b></td>
      <td align="right"><?php echo number_format($bill['total_bill_price'])?> VNĐ</td>
    </tr>

  </tbody><?php }?></table>
</div>
<?php }?>
</body></html>